function getCacheCartProductIdList() {
  let cacheCartIds = new Set(wx.getStorageSync('userCart').split(','))
  cacheCartIds.delete('')
  return cacheCartIds
}

function removeFromCartProductList(productid){
  let cacheCartIds = new Set(wx.getStorageSync('userCart').split(','))
  cacheCartIds.delete('')
  cacheCartIds.delete(String(productid))
  wx.setStorageSync('userCart', [...cacheCartIds].join(','))
}
function getCartProductNum(productId){
  return wx.getStorageSync('cart-' + String(productId))
}
function removeCartProductNum(productId){
  wx.removeStorageSync('cart-'+String(productId))
}
function setCartProductNum(productId,number){
  wx.setStorageSync('cart-' + String(productId), number)
}
module.exports={
  getCacheCartProductIdList,
  getCartProductNum,
  setCartProductNum,
  removeCartProductNum,
  removeFromCartProductList 
}